<template>
  <div>
    <el-card shadow="never">
      <h3>公告列表</h3>
    </el-card>
    <br>
    <div>
      <div v-for="item in list" :key="item.id" class="article-card">
        <div class="title" @click="$router.push(`/NoticeDetail/${item.id}`)">{{ item.title }}</div>
        <div class="time">{{ item.createTime | formatDate2 }}</div>
      </div>
    </div>

  </div>
</template>

<script>
import * as noticeApi from '@/api/notice'
export default {
  name: '',
  data() {
    return {
      list: []
    }
  },
  created() {
    noticeApi.list().then(resp => {
      this.list = resp.data
    })
  },
  methods: {
  }
}
</script>

<style lang="scss" scoped>
.article-card{
  border-bottom: 1px solid #eee;
  padding: 8px 16px;
  margin-bottom: 24px;
  .title{
    font-size: 16px;
    font-weight: bold;
    &:hover{
      cursor: pointer;
      color: #1890ff;
    }
  }
  .time{
    font-size: 12px;
    color: #999;
    margin-top: 8px;
  }
}
</style>
